package com.chenjj.scala.oo


/**
  * 构造函数
  */
class  Person(val firstName:String,val lastName:String) {
  private var position:String=_

  println("Creating "+ toString)

  def this(firstName:String,lastName:String,positionHeld:String){
    this(firstName,lastName)
    position = positionHeld
  }

  override def toString: String ={
    "firstName :" + firstName + ", lastName:" + lastName + ",position:" + position
  }

}
